package com.tech.platform.cms.common.utils;

import cn.hutool.core.collection.CollUtil;

import java.util.Map;

public class StringUtils {

    public static Map<String,String> queryStrToMap(String queryStr){
        final Map<String,String> result = CollUtil.newHashMap();
        String[] parameters = queryStr.split("&");
        CollUtil.newArrayList(parameters).forEach(parameter->{
            String[] keyValue = parameter.split("=");
            if(keyValue.length==2){
                result.put(keyValue[0],keyValue[1]);
            }
        });
        return result;
    }
}
